Skip to content

Support Inkling 2 Mini checkpoints - #55

Closed
scaryrawr wants to merge 24 commits into
mainfrom
inkling2-mini-support
Closed

scaryrawr wants to merge 24 commits into
mainfrom
inkling2-mini-support

Conversation

@scaryrawr

Copy link
Copy Markdown
Owner

Summary

Serve the original Inkling 2 Mini checkpoint through the existing Inkling VLM adapter. The looped decoder shares physical weights but keeps separate KV and convolution state for every visit. Checkpoint loading retains mixed NVFP4 and MXFP8 expert weights. Mini uses the existing Inkling tool and reasoning parser. This does not enable Mini's bundled DSpark draft or update dependencies.

The loop and weight mapping follow huggingface/transformers#51050. Neywa-Labs/mlx-vlm#2738 supports Inkling 2 Small, not Mini.

Validation

  • uv run --no-sync --python python3.12 pytest -q tests/test_inkling_vlm_mtp.py tests/test_output_parser.py tests/test_model_discovery.py passed (379 tests).
  • Apple M4 Max, 128 GiB: the released Mini checkpoint returned the expected answer from /v1/chat/completions. Pi completed a streamed read/edit/tool-result round trip against the same checkpoint; its edited code passed the task assertions. The server restored Mini's prompt cache on follow-up turns.

Checklist

  • I read CONTRIBUTING.md.
  • I understand every change in this PR and can explain it in review.
  • For UI or UX changes, I attached before and after screenshots.

scaryrawr and others added 23 commits November 20, 2026 09:40
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…l support

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…unches

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the separate Imagine page with model-aware chat image tools, uploaded and generated image references, translated controls, and production JavaScript regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Parametrize repeated cases, replace browser-logic replicas with production JavaScript tests, and scope shared state through fixtures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Clear cached model and parser namespaces before importing the vendored MiniMax implementations, including parent-package bindings and the router source-precision predicate.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Omit transcript cards without text or reasoning while retaining paired tool-call turns in API history.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Store chat-owned image attachments, migrate saved histories, and export images in archives. Make attachment/history writes atomic, protect unsaved live conversations through deletion and eviction failures, retry storage initialization, and normalize model aliases after discovery. Cover persistence recovery and lifecycle races.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add hosted and client tool discovery, namespace-aware identities, continuation history, and streaming search results. Cover plain-text input, reasoning turns, engine failures, and namespace/MCP collisions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse the Qwen4 capture and speculative cache transaction for the paired DFlash2 drafter. Preserve native MTP residual states and observe committed ordinary-decode tokens.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Iterate template values directly, name test sentinel exceptions consistently, and combine their context managers without changing behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test(admin): cover per-model context persistence

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(admin): persist per-model context changes

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(admin): await superseded model refreshes

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Fix persisted profile context reloads

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Emit explicit catalog context ceilings and compaction budgets, use selected-model limits when status is unavailable, and respect user compaction settings across configuration rewrites.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Drop the mlx-embeddings wrapper path from the new tokenize endpoints and exercise the tokenizer and processor shapes supported by the fork.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* feat(lora): serve PEFT adapters as separate models

Resolve each adapter to a local MLX checkpoint and apply its projections in memory. Keep adapter caches separate without rewriting base weights.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(admin): manage LoRA adapter downloads and base selection

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(mac): show LoRA compatibility on download cards

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Support routed expert LoRA on compatible MLX MoE models

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Close LoRA adapter identity and execution gaps

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Keep LoRA layer and model identities distinct

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Block stale LoRA entries after adapter directory replacement

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Reject incompatible LoRA initializers and isolate prefill controls

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the engine entry and model settings contracts for prefill helpers, and import the state capacity helper used by batched TurboQuant caches.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 21:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The looped decoder and mixed packed-weight loading require human numerical validation on Apple Silicon because independent reference parity and MLX runtime behavior could not be verified in this review environment.

No open issues 🎉

What changed in this PR

Adds support for original Inkling 2 Mini checkpoints through oMLX’s existing Inkling VLM adapter, including tool calls and reasoning parsing.

Changes:

  • Implements looped decoding with shared layer weights and separate cache state for each visit.
  • Loads Mini’s checkpoint mappings while preserving mixed NVFP4 and MXFP8 expert weights.
  • Adds cache, checkpoint-loading, and parser regression tests, plus documentation of supported inputs. Bundled DSpark decoding remains unsupported.
File Description
tests/​test_output_parser.py Tests Mini parser detection independently of model name.
tests/​test_inkling_vlm_mtp.py Tests per-visit caches, shared layers, and packed checkpoint loading.
README.md Documents Mini setup and unsupported features.
omlx/​patches/​inkling2/​vlm.py Registers Mini and selects its loop-aware model and loading path.
omlx/​patches/​inkling2/​model.py Adds message controllers, split projections, and configurable cache counts.
omlx/​patches/​inkling2/​loop.py Implements loop validation, repeated layer execution, and cross-pass messages.
omlx/​patches/​inkling2/​loader.py Maps Mini’s cross-pass queries, projections, and controller weights.
omlx/​model_discovery.py Recognizes Mini as a VLM model type.
omlx/​engine/​vlm.py Routes Mini through the Inkling loader.
omlx/​api/​utils.py Includes Mini in reasoning-content handling.
omlx/​adapter/​output_parser.py Enables the existing Inkling output parser for Mini.

Review effort: Balanced

@scaryrawr
scaryrawr marked this pull request as ready for review November 20, 2026 21:56
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 00:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Reported hardware checks do not exercise Lightning MTP, leaving released Mini draft loading, capture IDs, and multi-token rejection/rollback across repeated layer visits in need of Apple Silicon validation.

No open issues 🎉

Review effort: Balanced

@scaryrawr

Copy link
Copy Markdown
Owner Author

Superseded by upstream commit 24e5f90, now on main. It adds Inkling 2 Mini support and opt-in DSpark. The PR branch remains available for reference.

@scaryrawr scaryrawr closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants